package Chapter03;

public class Question1
{
   //求1！+2！+3！+4！+5！+6！+7！+8！+9！+10！的和
    public static void main(String[] args) {
        int total = 0;int sum;
        for (int i = 1; i <= 10; i++) {
            sum= 0;
            for (int j = 1; j <= i; j++) {
                sum += j;
                total += sum;
            }
            System.out.println(i + "!=" + sum);
        }
        System.out.println("1！+2！+3！+4！+5！+6！+7！+8！+9！+10！的和为：" + total);
    }


}

